#ifndef UGLOBAL_GL_FUNCTIONS_H
#define UGLOBAL_GL_FUNCTIONS_H
	#include "stdafx.h"
	#include "UStringUtils.h"
	#include "UVector.h"
	
	/* Global Variables */
	extern PFNGLGENBUFFERSARBPROC glGenBuffersARB ;				// VBO Name Generation Procedure
	extern PFNGLBINDBUFFERARBPROC glBindBufferARB ;					// VBO Bind Procedure
	extern PFNGLBUFFERDATAARBPROC glBufferDataARB ;					// VBO Data Loading Procedure
	extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB ;

		#ifdef DEBUG
			#define PRINT_GL_ERROR_FLAGS cout << STRFORMAT("got GL Error #%i\n", err)
		#else
			#define PRINT_GL_ERROR_FLAGS
		#endif

	#define CLEAR_GL_ERROR_FLAGS while(GLenum err = glGetError()) { PRINT_GL_ERROR_FLAGS; }
	
	struct gluRenderParams {
		GLdouble modelViewMatrix[16];
		GLdouble projectionMatrix[16];
		GLint    viewport[4];
	};
	struct TVector projectPoint(const TVector& v, gluRenderParams &params, TDockable * window = NULL);

#endif
